package org.argeproje.resim.ui.component.view;

import org.argeproje.resim.proc.view.ViewerPR;
import org.argeproje.resim.property.StringPRP;
import org.argeproje.resim.ui.model.ComponentItem;


public class ViewerCI extends ComponentItem{

	private static final long serialVersionUID = 1;
	private static final String TITLE_PROP = "ViewerCI.Title";	
	private String _title;
	
	public ViewerCI()
	{		
		super();
		_name = "Viewer";
		_description = "View an output";
		initProc();
	}		

	
	public void setTitle(String title)
	{
		_title = title;
	}
	
	public String getTitle()
	{
		return _title;
	}	
	public Class<ViewerCI> getComponentClass() {
		return ViewerCI.class;
	}
	
	protected void initDescriptorList()
	{
		super.initDescriptorList();
		registerProperty(new StringPRP(this, TITLE_PROP, "Title", "getTitle", "setTitle"));
	}

	public void initProc() {
		if(_processor == null)
		{
			_processor = new ViewerPR();
		}
		setTitle("Viewer");
	}
	
	public void updateProc() {
		if(_processor == null)
		{
			_processor = new ViewerPR();
		}
		((ViewerPR)_processor).setParameters(getTitle());
	}
}
